class Elem_Iput():
    cms_account_input=("id",'userAccount')
    cms_passwd_input=("id","loginPwd")
    cms_loginbtn_input=("id","loginBtn")
    desk_top_input=("xpath",'//*[@title="我的桌面"]')
    usercenter_input=("xpath",'//*[@id="menu-user"]/dt')


class Bbselem_Iput():
    bbs_account_input=("id","ls_username")
    bbs_passwd_input=("id","ls_password")
    bbs_loginbtn_input=("XPATH",'//*[@id="lsform"]/div/div/table/tbody/tr[2]/td[3]/button')
    bbs_my=("link_text","我的")
    bbs_tiezi=("LINK_TEXT","帖子")
    bbs_post_btn=("XPATH",'/html/body/div[7]/div[2]/div/div/div[2]/a/img')
    bbs_Discuz=("XPATH",'/html/body/div[1]/div/table/tbody/tr[2]/td[2]/div[2]/ul/li[1]/p[2]/a')
    bbs_MRmokuai=("XPATH",'//*[@id="block_forum"]/p/a')
    bbs_new_post=("XPATH",'//*[@id="postbtn"]')
    bbs_title=("XPATH",'//*[@id="subject"]')
    bbs_iframe=("XPATH",'/html/body')
    bbs_post=("XPATH",'//*[@id="postsubmit"]')
    bbs_framename=("id","e_iframe")
    bbs_discuz_img=("xpath",'//*[@id="hd"]/div/div[1]/h2/a/img')
    bbs_first_arc=("xpath",'/html/body/div[7]/div[2]/div/div/div[3]/div[2]/table/tbody/tr/th/a')
    bbs_deletebtn=("LINK_TEXT","删除主题")
    bbs_delete_reasons=("XPATH",'//*[@id="moderateform"]/div/div[2]/h4/a')
    bbs_reason1=("LINK_TEXT","广告/SPAM")
    bbs_reason2 = ("LINK_TEXT","恶意灌水")
    bbs_reason3 = ("LINK_TEXT","违规内容")
    bbs_reason4 = ("LINK_TEXT","文不对题")
    bbs_reason5 = ("LINK_TEXT","重复发帖")
    bbs_reason6 = ("LINK_TEXT","我很赞同")
    bbs_reason7 = ("LINK_TEXT","精品文章")
    bbs_reason8 = ("LINK_TEXT","原创内容")
    bbs_sure_delete=("xpath",'/html/body/div[1]/div[2]/table/tbody/tr[2]/td[2]/div/form/p/button')
    bbs_select_all=("xpath",'//*[@id="chkall"]')
    bbs_delete_zhuti=("name",'delsubmit')
    bbs_rec_zhuti=("xpath",'//*[@id="cpform"]/table/tbody/tr[4]/td/div/input[3]')
    bbs_notice=("xpath",'//*[@id="myprompt"]')
    bbs_managework = ("xpath", '//*[@id="ct"]/div[2]/div[1]/ul/li[5]/a')
    bbs_do_now = ("link_text", '现在处理')
    bbs_framename1=("xpath",'//*[@id="main"]')
    bbs_quit=("link_text",'退出')
    bbs_huifu=('xpath','//*[@id="post_reply"]/img')
    bbs_admin_password=("name",'admin_password')
    bbs_tijiao=("xpath",'//*[@id="loginform"]/p[9]/input')


class Tpshop_elems:
    login=("link_text","登录")
    username=("id","username")
    passwd=("id","password")
    verify=("id","verify_code")
    loginbtn=("name","sbtbutton")
    address_manage=("link_text","地址管理")
    add_new_address=("link_text","增加新地址")
    iframe=("xpath",'//*[@id="layui-layer-iframe100001"]')
    name=("xpath","/html/body/div/div/div/form/table/tbody/tr[1]/td[2]/input")
    province=("name","province")
    city=("xpath",'//*[@id="city"]')
    town=("xpath",'//*[@id="district"]')
    place=("xpath",'//*[@id="twon"]')
    local=("xpath",'//*[@id="address"]')
    savebtn=("xpath",'/html/body/div/div/div/form/table/tbody/tr[6]/td[2]/button')
    admin_name=("xpath",'//*[@id="theForm"]/div/div[1]/div[2]/div[1]/input')
    admin_passwd=("xpath",'//*[@id="theForm"]/div/div[1]/div[2]/div[2]/input')
    admin_verify=("xpath",'//*[@id="theForm"]/div/div[1]/div[2]/div[3]/input')
    surebtn=("xpath",'//*[@id="theForm"]/div/div[1]/div[2]/div[5]/span/input')
    shop=("link_text",'商城')
    onsale=("xpath",'//*[@id="admincpNavTabs_shop"]/dl[3]/dt/a')
    juan=("xpath",'//*[@id="admincpNavTabs_shop"]/dl[3]/dd/ul/li[5]/a')
    iframe1=("xpath",'/html/body/div[2]/div[2]/iframe')
    iframe2=("xpath",'//*[@id="workspace"]')
    add_juan=("xpath",'/html/body/div[3]/div[3]/div[3]/div[1]/a/div/div')
    juan_name=("xpath",'//*[@id="name"]')
    juan_money=("xpath",'//*[@id="money"]')
    spend_money=("xpath",'//*[@id="condition"]')
    juan_count=("xpath",'//*[@id="createnum"]')
    juan_status=("xpath",'//*[@id="handleposition"]/div/dl[13]/dd/input[1]')
    juan_btn=("link_text","确认提交")


# 页面元素
class Analysysdata_elem():
    login_btn="//a[contains(text(),'登录')]"
    login_text="//div[contains(text(),'登录')]"
    account_num_input="//input[@placeholder='用户名/手机号/邮箱']"
    password_input="//input[@placeholder='请输入密码']"
    uba_login_btn="//span[contains(text(),'登 录')]/.."
    policy_center_text="//span[contains(text(),'策略中心')]"
    ea_operate="//span[contains(text(),'方舟智能运营')]"
    setting_btn="//i[@id='setting']"
    role_members_btn="//span[contains(text(),'角色和成员')]"
    role_man_text="//li[contains(text(),'角色管理')]"
    add_role_btn="//span[contains(text(),'创建角色')]"
    input="//input[@placeholder='请填写']"
    next_step_btn="//span[contains(text(),'下一步')]"
    cancel_btn="//span[contains(text(),'取消')]"
    finish_btn="//span[contains(text(),'完成')]"
    function_setting_text="//span[contains(text(),'功能权限设置')]"
    def function_switch_btn(function):
        return "//span[contains(text(),'%s')]/following-sibling::span/span"%function
    add_cohort="//li[contains(text(),'添加用户属性')]"
    department_btn="//span/span[contains(text(),'所属营业部编号')]"
    def select_cohort(cohort):
        return "//li/a//span[contains(text(),'%s')]"%cohort
    # select_condition="//span/span[contains(text(),'%s')]/parent::*/parent::*/following-sibling::span//span[contains(text(),'%s')]"cohort%,condition%
   #sms
    sms_list="//a[@title='短 信']"
    create_sms_btn="//span[contains(text(),'创建短信')]"
    input_sms_name="//input[@placeholder='输入活动名称']"
    target_customer_text="//div[contains(text(),'目标用户')]"
    select_target_customer_segmention="//input[@placeholder='请选择目标用户']"
    search_customer_segmention="// input[ @ placeholder = '搜索']"
    target_customer="//span[contains(text(),'tianli')]/.."
    select_service_customer="//input[@placeholder='请选择短信服务商']"
    dfnm_sms="//span[contains(text(),'东风通讯')]"
    select_template="//input[@placeholder='请选择模板']"
    easy_template="//span[contains(text(),'简易短信')]"
    parameter_template = "//span[contains(text(),'参数模板')]"
    post_sms_btn="//span[contains(text(),'  开 始')]"
    #webhook
    webhook_list = "//a[@title='Webhook']"
    add_webhook_btn="//span[contains(text(),'创建Webhook')]"
    third_party_system="//div[contains(text(),'第三方系统集成')]"
    input_webhook_name="//input[@placeholder='输入活动名称']"
    select_third_party_system="//label[contains(text(),'第三方配置')]/..//input"
    select_api="//span[contains(text(),'ea_logs-push')]"
    select_connect="//label[contains(text(),'选择连接')]/..//input"
    select_ea_api = "//span[contains(text(),'JSON')]"
    post_webhook_btn="//span[contains(text(),'开 始')]"
    #workflow
    wf_list= "//a[@title='Workflow 活动']"
    create_wf_btn="//span[contains(text(),'创建 Workflow 活动')]"
    cancel_wf_btn="//span[contains(text(),' 取 消' )]"
    input_wf_name="//input[@placeholder='输入活动名称']"
    time_range="//input[@placeholder='请选择活动时间范围']"
    fangzhoufenqun="//i[@class='iconfont icon-fangzhoufenqun']"
    click_edit="//a[contains(text(),'点击编辑')]"
    OK_btn="//span[contains(text(),'确 定')]"
    clustering_component="//label[contains(text(),'设置用户分群')]"
    add_step="//span[contains(text(),'添加步骤')]"
    event_condition="//i[@class='con-i iconfont icon-fenzhi']/.."#事件条件
    user_condition = "//i[@class='con-i iconfont icon-guolvqi']/.."  # 人群条件
    waiting_condition = "//i[@class='con-i iconfont icon-dengdai']/.."  # 等待条件
    sms_channel="//li[@data-type='channel']//i[@class='iconfont icon-duanxin1']"#短信通道
    webhook_channel="//li[@data-type='channel']//i[@class='iconfont icon-webhook']"#webhook通道
    user_properties_select="//span[contains(text(),'用户ID')]/../i"
    search_user_properties = "//input[@placeholder='搜索']"
    phone_property="//span[contains(text(),'手机号')]"
    input_value = "//input[@placeholder='请选择或者输入']"
    yes_btn="//div[@class='flow-node-drag item-ul']//span[contains(text(),'是')]"
    no_btn="//div[@class='flow-node-drag item-ul']//span[contains(text(),'否')]"
    user_component="//label[contains(text(),'人群条件')][@class='bd text-overflow']"#人群条件组件
    start_time="//div[@class='x-date-packer-panel date-start']//label[@data-mouseover='2024-3-31']"
    def end_time(time):
       return "//div[@class='x-date-packer-panel date-end']//label[@data-mouseover='%s']"%time#格式：2024-3-31
    release_wf="//span[contains(text(),'发 布')]"





